<?php

namespace App\Jobs;

use App\Models\TestRegion;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class TestJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $region;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct(TestRegion $region)
    {
        $this->region = $region;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $this->region->province_id = 2;
        $this->region->city_id = 5;
        $this->region->district_id = 6;
        $this->region->save();
    }
}
